package service.Supper.impl;

import dao.BaseDao;
import dao.Supper.SuperCustomerDao;
import dao.Supper.SuperuserDao;
import dao.Supper.impl.SuperCustomerDaoImpl;
import dao.Supper.impl.SuperuserDaoImpl;
import pojo.Customer;
import pojo.Superuser;
import service.Supper.SuperCustomerService;
import service.Supper.SuperuserService;

import java.util.List;

/**
 * 客户服务层
 */
public class SuperCustomerServiceImpl extends BaseDao implements SuperCustomerService {
    private SuperCustomerDao superCustomerDao;
    public SuperCustomerServiceImpl(){
        superCustomerDao = new SuperCustomerDaoImpl();
    }

   //根据id进行查询
    public List<Customer> selCusByID(Long id) {
        return superCustomerDao.selCusByID(id);
    }

    //得到总数据行
    public int getTotalCount(Long id, String cusName, String cusSex) {
        return superCustomerDao.getTotalCount(id,cusName,cusSex);
    }

    //显示数据
    public List<Customer> selCustomer(int currentPage, int pageSize, Long id, String cusName, String cusSex) {
        return superCustomerDao.selCustomer(currentPage,pageSize,id,cusName,cusSex);
    }

   //修改
    public int updateScus(Customer customer) {
        return superCustomerDao.updateScus(customer);
    }

    //删除
    public int delScus(Long id) {
        return superCustomerDao.delScus(id);
    }
}
